package com.haidechizi.i18n.code.generator.common.propconvert.generator;


import com.haidechizi.i18n.code.generator.common.GlobalConfig;
import com.haidechizi.i18n.code.generator.common.propconvert.param.PropConvertConfig;

import java.util.Optional;

/**
 * @author wangdejun
 * @create 2020/10/17 17:40
 */
public class PropGenerators {

    /**
     * 生成File
     *
     * @param propConvertConfig
     * @return
     */
    public String generator(PropConvertConfig propConvertConfig) {
        PropGenerator generator = PropGeneratorFactory.getGenerator(propConvertConfig.getGeneratorType());
        GlobalConfig.setTranslateType(propConvertConfig.getTranslateType());
        Optional.ofNullable(generator).orElseThrow(RuntimeException::new);
        generator.generator(propConvertConfig);
        return null;
    }

}
